package paquete_aux;

import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;

public class Generador_csv {

	public static void main(String[] args) {

		File salida = new File("data/resultados.csv");
		if (!salida.exists()) {
			try {
				salida.createNewFile();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		try {
			PrintWriter escritor = new PrintWriter(salida);
			String s = null;
			
			s = ("nombre" + 0+";");//nombre
			s +="apellido" + 0+";";//apelido
			s+=(1000)+";";//cedula
			int valor = (int) (Math.random()*100000);
			s +=valor+";";//valor a pagar
			int edad = (int) (Math.random()*115);
			s+=edad+";";//edad
			int nit = (int) (Math.random()*5);
			s += (nit+11000)+";\n";//cedula
			
			for (int i = 1; i < 10000; i++) {
				
				s += ("nombre" + i+";");//nombre
				s +="apellido" + i+";";//apelido
				s+=(i+1000)+";";//cedula
				valor = (int) (Math.random()*100000);
				s +=valor+";";//valor a pagar
				edad = (int) (Math.random()*115);
				s+=edad+";";//edad
				nit = (int) (Math.random()*5);
				s += (nit+11000)+";\n";//cedula
			}
			
			escritor.write(s);
			escritor.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}